<template> <!-- vue实例外创建 -->
    <el-menu :collapse="isCollapse" 
    :style="{ width: !isCollapse ? '230px' : '64px' }"
    active-text-color="#ffd04b" 
    background-color="#545c64" 
    class="el-menu-vertical-demo"
        default-active="2" 
         
        unique-opened text-color="#fff" @open="handleOpen"
        @close="handleClose">
        <p class="container-log">{{ isCollapse ? 'DIDI' : 'DIDI陪诊' }}</p>
        <!-- 向父组件传递数据 -->
        <TreeMenu :menuData="menuData" :index="1" />

    </el-menu>
</template>
<!-- 调用   <mycom></mycom> -->
<script setup>
import TreeMenu from './treeMenu.vue'
import { useRouter } from 'vue-router'
import { reactive, computed } from 'vue'
import { useMenuStore } from '../store/modules/menu.js'


const menuStore = useMenuStore()
const isCollapse = computed(() => menuStore.isCollapse)


const router = useRouter()
// console.log(router ,'router')

const menuData = reactive(router.options.routes[0].children)
// console.log(menuData ,'menuData')

const handleOpen = () => {
    console.log()
}
const handleClose = () => {
    console.log()
}
</script>
<style lang="less" scoped>
.container-log {
    width: 100%;
    height: 50px;
    line-height: 50px;
    color: #fff;
    font-size: 18px;
    margin: 0;
    text-align: center;
}

.el-menu-vertical-demo {
    height: 100%;
}




</style>